Streamed batched indexer with dedupe and max-index limit#932
Merged
multiplex55 merged 2 commits intomasterfrom Mar 15, 2026
Merged
Streamed batched indexer with dedupe and max-index limit#932multiplex55 merged 2 commits intomasterfrom
multiplex55 merged 2 commits intomasterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Vec<Action>up front when indexing large trees to reduce peak memory usage and startup latency.Description
IndexOptionsandIndexBatchIterand a new APIindex_paths_batched(paths, options)that yieldsanyhow::Result<Vec<Action>>batches for streaming consumption. A compatibility helperindex_pathsexhausts the iterator for callers that need aVec<Action>.HashSet<PathBuf>and enforced amax_itemscap while iterating; defaults are provided viaIndexOptions::default()and helperIndexOptions::with_max_items(...).src/main.rsto consume batches fromindex_paths_batchedwithIndexOptions::with_max_items(settings.max_indexed_items)and merge batches intoactions_vecprogressively.src/gui/mod.rsto iterate batches fromindex_paths_batched, extendactsper-batch, and refreshself.actions,update_action_cache()andsearch()progressively as batches arrive, while still finalizing state at the end of the reload.Settings.max_indexed_items: Option<usize>and preserved it inSettingsEditor::to_settingsso users can control the indexing cap via settings.tests/indexer.rsto verify canonicalized output, deduplication across duplicate roots, batch sizing and honoringmax_items.Testing
cargo fmtwhich completed successfully.tests/indexer.rscovering recursive indexing, canonicalized/display paths, batching, dedupe andmax_itemsbehavior (new tests included in the commit).cargo test tests::indexer -- --nocaptureandcargo test --test indexer --no-default-features, but the local build was blocked by a missing system dependency required byalsa-sys(missingalsa.pc/ pkg-config), so the test run failed to complete in this environment.Codex Task